Repository navigation
Conversation
joseph5wu
requested changes
Nov 12, 2026
| @@ -0,0 +1,112 @@ | |||
| /* | |||
Contributor
There was a problem hiding this comment.
@prapty : Can you address the pre-commit action failure?
We recently enforced a new copyright header for any new cpp files. You can find out more from https://github.com/meta/fboss/actions/runs/43297841198/job/131460795732?pr=1969
Add fboss2 config and delete commands for sFlow collector IP and UDP port tuples in the staged agent configuration. Validate argument arity, canonical IP addresses, and the positive range supported by the existing i16 port schema. Preserve unrelated collectors, make repeated additions idempotent, and remove canonical duplicates on deletion. Add focused coverage for IPv4, IPv6, validation boundaries, persistence, tuple matching, idempotency, and safe missing-entry behavior.
prapty
force-pushed
the
sflow-collector-config-cli
branch
from
November 13, 2026 18:09
e8295d8 to
ca036da
Compare
Contributor
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D131864222. |
Contributor
|
@joseph5wu merged this pull request in 225f9f6. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
Add
fboss2 config sflow-collector <ip> <port>andfboss2 delete sflow-collector <ip> <port>commands for managing sFlow collector tuples through the standard FBOSS config session.The shared argument type requires exactly one collector IP address and UDP port, accepts IPv4 and IPv6, stores canonical address spellings, and validates the positive range representable by the existing signed
i16collector-port schema.Adding an existing tuple is idempotent and preserves unrelated collectors. Deletion matches the complete address/port tuple and removes semantically identical entries, including legacy IPv6 spellings, without affecting other collectors.
Changes are staged at the hitless action level and become active only after
fboss2 config session commit.Test Plan
pre-commit run --from-ref upstream/main --to-ref HEADfboss2_cmd_config_testfor IPv4 and IPv6 parsing, canonicalization, argument and port validation, persistence, idempotent addition, complete-tuple matching, canonical duplicate deletion, and safe handling of missing collectors.CmdConfigSflowCollectorTestFixturetests successfully.Actual sampled-packet delivery to the configured collector was not validated as part of this testing.
Replacement for #1667, which was automatically closed.